#ifndef SPHERE_H
#define SPHERE_H

#include <cstdlib>

#include <QVector3D>

class Sphere
{
public:
    static bool intersection(const Sphere& rkA, const Sphere& rkB, QVector3D* pkContact = NULL);

    Sphere(void* pkUserData = NULL);
    Sphere(const QVector3D& rkCenter, qreal radius = 0, void* pkUserData = NULL);
    Sphere(qreal x, qreal y, qreal z, qreal radius = 0, void* pkUserData = NULL);
    ~Sphere();

    Sphere(const Sphere& rkOther);
    Sphere& operator = (const Sphere& rkOther);

    bool isValid() const;

    qreal x() const;
    qreal y() const;
    qreal z() const;
    QVector3D center() const;
    qreal radius() const;

    void setPosition(const QVector3D& rkCenter);
    void setRadius(qreal kRadius);

    void* userData() const;
    void setUserData(void* pkUserData);


private:
    QVector3D m_kCenter;
    qreal     m_Radius;
    void*     m_pkUserData;
};

#endif // SPHERE_H
